import pandas as pd

if __name__ == '__main__':

  # 创建数据
  data = {
      '姓名': ['张飞', '关羽', '赵云', '黄忠', '典韦'],
      '语文': [66, 95, 93, 90, 80],
      '英语': [65, 85, 92, 88, 90],
      '数学': [30, 98, 96, 77, 90]
  }

  # 创建 DataFrame
  df = pd.DataFrame(data)

  # 保存为 Excel 文件
  excel_file_path = '/Users/longhairen/Documents/pycharm/learn-python/data/students_scores.xlsx'
  df.to_excel(excel_file_path, index=False)

  print(f'Excel 文件已成功创建: {excel_file_path}')